#include <stdio.h>
#include <stdlib.h>
#include <cmath>
void main()
{
	int check;
    float a, b, c, D, x1, x2;
    printf("Enter coefficients a, b, c with spaces between them:\n");
	check=scanf("%f %f %f", &a, &b, &c);
	a = 1;
	b = b/a;
	c = c/a;
	if(check!=3)
		{
			printf("Wrong input!\n");
			return;
		}
    if (a==0 && b==0 && c==0)
		{
			printf ("Ifinite value of roots of equation\n");
		}
    else
        if(a==0 && b!=0 && c!=0)
			{
				printf("Root of equation: %f\n",-c/b);
			}
        else
			{

				if (a==0 && b==0 && c!=0 || b*b-4*c <0)
					{
						printf ("There are no root of equation\n");
					}
				else
					{
						D=b*b-4*c;
						D=sqrt(D);
						if(D==b)
							{
								x2=-b;
								x1=c/x2;
								printf ("Roots of equation: %.20f, %f\n",x1,x2);
							}
						if(D==-b)
							{
								x2=-b;
								x1=c/x2;
								printf ("Roots of equation: %.20f, %f\n",x1,x2);
							}
						if((D!=b) && (D!=-b))
							{
								x2=(-b+D)/2;
								x1=(-b-D)/2;
								printf ("Roots of equation: %f, %f\n",x1,x2);
							}
					}
			}
system("PAUSE");
}

